import request from '@/utils/request'

// 查询工器具借出列表
export function listBorrow(query) {
  return request({
    url: '/mes/tm/borrow/list',
    method: 'get',
    params: query
  })
}

// 查询工器具借出详细
export function getBorrow(documentId) {
  return request({
    url: '/mes/tm/borrow/' + documentId,
    method: 'get'
  })
}

// 新增工器具借出
export function addBorrow(data) {
  return request({
    url: '/mes/tm/borrow',
    method: 'post',
    data: data
  })
}

// 修改工器具借出
export function updateBorrow(data) {
  return request({
    url: '/mes/tm/borrow',
    method: 'put',
    data: data
  })
}

// 删除工器具借出
export function delBorrow(documentId) {
  return request({
    url: '/mes/tm/borrow/' + documentId,
    method: 'delete'
  })
}
//确认
export function confirme(documentId) {
  return request({
    url: '/mes/tm/borrow/status/' + documentId,
    method: 'put'
  })
}
//执行借出
export function execute(documentId) {
  return request({
    url: '/mes/tm/borrow/' + documentId,
    method: 'put'
  })
}
